package com.key.puzzlemodel.transverselongitudinal.fragment

import android.content.Context
import android.os.Bundle
import android.view.View
import com.key.puzzlemodel.R
import com.key.puzzlemodel.base.BaseMenuFragment
import com.key.puzzlemodel.databinding.FragmentMenuBinding
import com.key.puzzlemodel.transverselongitudinal.IPuzzleInterFace
import com.key.puzzlemodel.transverselongitudinal.TransverseLongitudinalMVVMViewModel


/**
 *
 * @功能描述:     菜单fragment
 * @创建时间:     2022/1/5
 * @创建者:       阳
 * @修改时间:     2022/1/5
 * @修改者:       阳
 */
class MenuFragment : BaseMenuFragment<FragmentMenuBinding, TransverseLongitudinalMVVMViewModel>(), View.OnClickListener {

    override val layoutId: Int
        get() = R.layout.fragment_menu


    override fun onAttach(context: Context) {
        super.onAttach(context)
        puzzleInterface = context as IPuzzleInterFace
    }

    override fun initView(savedInstanceState: Bundle?) {
        mVDB.clickListener = this
    }

//    override fun getMenuType(): Int {
//        return MENUTYPE
//    }

    override fun onClick(v: View) {
        when (v.id) {
//            R.id.tab_menu_layout -> {
//                puzzleInterface.clickMenuLayout()
//            }
            R.id.tab_menu_border -> {
                puzzleInterface.clickStartFragment(mVM.BORDERTYPE)
            }
            R.id.tab_menu_edit -> {
                puzzleInterface.clickStartFragment(mVM.EDITTYPE)
            }
            R.id.tab_menu_bg -> {
                puzzleInterface.clickStartFragment(mVM.BACKGROUNDTYPE)
            }
        }
    }


}